commands/extcmd: Missing check for failed allocation
authorLidong Chen <lidong.chen@oracle.com>
Fri, 22 Nov 2024 06:27:55 +0000 (06:27 +0000)
committerMiao Wang <shankerwangmiao@gmail.com>
Sun, 15 Feb 2026 13:50:20 +0000 (13:50 +0000)
commit623b118522c475d928854ac25e65458b1ba001c1
treec225fb606d0e0f04e1ddedfb284757858fef03f2
parent7de5f2847a3cc6bfd8f542f33cb8e785c8278ba3
commands/extcmd: Missing check for failed allocation

The grub_extcmd_dispatcher() calls grub_arg_list_alloc() to allocate
a grub_arg_list struct but it does not verify the allocation was successful.
In case of failed allocation the NULL state pointer can be accessed in
parse_option() through grub_arg_parse() which may lead to a security issue.

Fixes: CVE-2024-45775
Reported-by: Nils Langius <nils@langius.de>
Signed-off-by: Lidong Chen <lidong.chen@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Reviewed-by: Alec Brown <alec.r.brown@oracle.com>
Gbp-Pq: Topic cve-2025-jan
Gbp-Pq: Name commands-extcmd-Missing-check-for-failed-allocation.patch
grub-core/commands/extcmd.c